<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<base href="<%=basePath%>">

		<title>圖片</title>
		<script type="text/javascript">
			function clickd(cs,w,h){
				//var gs = document.getElementById("bmgs").value;
				document.getElementById("jsdm").value = "<script>ycty_w="+w+";ycty_h="+h+";<\/script>\n<script type='text/javascript' src='http://192.168.1.119:8080/Produces/swt/tp.js' charset='"+cs+"'><\/script>";
			}
		</script>

	</head>

	<body>
		<h2 align="center">
			圖片页
		</h2>
		<br>
		<hr>
		<a href="NdImg.jsp">增加</a>
		<a href="index.jsp">首頁</a>

		<c:if test="${empty info}">
			<script>
				location = "GetImgs";
			</script>
		</c:if>
		<table align="center" border="1" width="100%">
			<tr>
				<td align="center">
					网&nbsp;站&nbsp;名&nbsp;称&nbsp;
				</td>
				<td align="center">
					网&nbsp;站&nbsp;网&nbsp;址&nbsp;
				</td>
				<td align="center">
					圖&nbsp;片&nbsp;尺&nbsp;寸&nbsp;
				</td>
				<td align="center">
					编&nbsp;码&nbsp;格&nbsp;式&nbsp;
				</td>
				<td align="center">
					<img src="imgs/ioc/1.gif" width="16" height="16">
					客&nbsp;戶&nbsp;代&nbsp;碼&nbsp;
				</td>
				<td align="center">
					操&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;作
				</td>
			</tr>
			<c:if test="${!empty info}">
				<c:forEach items="${imgs}" var="l">
					<tr>
						<td>
							${l.pathname }
						</td>
						<td>
							${l.weburl }
						</td>
						<td>
							<input type="text" value="${l.imgw }">
							W
							<input type="text" value="${l.imgh }">
							H
						</td>
						<td>
							${l.bmgs }
						</td>
						<td>
							${l.khdm }
						</td>
						<td>
							<a href="UpImg?id=${l.id }">修改</a>
							<a href="DeldeImg?id=${l.id }">刪除</a>
							<input type="button" value="使用" onclick="clickd('${l.bmgs }','${l.imgw }','${l.imgh }')">
						</td>
					</tr>
				</c:forEach>
			</c:if>
		</table>
		<h3 style="color: red;">
			統一js代碼:
		</h3>
		<textarea id="jsdm" rows="10" cols="100%">
			<script type='text/javascript'src='http://192.168.1.119:8080/Produces/js/tp.js'></script>
		</textarea>
		
	</body>
</html>